package main

import (
	"io/ioutil"
	"os"

	"github.com/russross/blackfriday"
)

func main() {
	// 读取文件
	file, _ := os.Open("./demo.md")
	defer file.Close()
	contentByte, _ := ioutil.ReadAll(file)

	// 解析成html
	output := blackfriday.MarkdownBasic(contentByte)

	// 打开文件
	fileHtml, _ := os.OpenFile("./demo.html", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0777)
	defer fileHtml.Close()
	fileHtml.Write(output)

}
